<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<script type="text/javascript" src="m/js/jquery.min.js"></script>
<script type="text/javascript" src="m/js/jquery.tmpl.min.js"></script>
<script type="text/javascript" src="m/js/cart.js"></script>
<script type="text/javascript" src="m/js/jquery.msg.src.js"></script>
<title>推荐列表 - 红高粱</title>
<style type="text/css">
header{ width:100%;}
header img{ width:100%;}
ul li { list-style:none;}
body{height:auto;margin-bottom:8%;margin-top:15%;background:url(m/images/c_shop_bg2_listfood2.jpg) repeat-y right;}
.clear{ clear:both;}
h1{ font:normal 1em "黑体"; color:#fff;text-align:left;}
h2{color:#fff; font-size:14px; font-weight:normal; padding:0 0 0px;text-align:left;line-height:1.8em;}
*{ margin:0; padding:0;}
.main{ width:100%; margin:0 auto; overflow:hidden;}
.main .img{ width:35%;height:86px; float:left; padding-left:0.6em;}
.main .img img{ width:100%; height:100%}
.main .list { width:98%; float:right;}
.main .list ul li{ background-position:bottom; overflow:hidden; padding:0.6em 0;}
.main .txt{width:60%; float:right; height:100%; margin:0 auto;text-align:center;}
.main .txt .order{ width:45%; float:right;padding-right:10%;}
.main .txt .order img{ width:80%;}
</style>
<script type="text/javascript">
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
WeixinJSBridge.call('hideToolbar');
});
</script>
<!-- 
.main .left{ width:25%;float:left; padding:0px 0 165px 0; border-right:1px solid #494e50;} 中间有根竖线
body{height:auto;margin-bottom:30%;margin-top:12.7%;background:url(../../m/images/c_shop_bg2.png) no-repeat right;
.main .left{ width:25%;float:left; background: url(../../m/images/menu_list_l_bg.png) repeat-y; padding:0px 0 165px 0; border-right:1px solid #494e50;}
.main .list ul li{ background: url(../../m/images/menu_list.png) repeat-x; background-position:bottom; overflow:hidden; padding:0.6em 0;}
.main .left .menu_ck{ background:url(../../m/images/menu_list_ck.png) repeat-x;background-size:contain;}
 -->
</head>
<body>
		
	<div class="main">
          
          <div class="list">
          	<ul>
          		<c:forEach var="rec" items="${recommends}" varStatus="var">
		          		<li style="border-bottom:0px solid #7f8487;">
		                	<div class="img"><a href="<c:url value="/recommenddetail/${rec.id }.html"/>"><img src="${rec.images }"></a></div>
		                    <div class="txt">
		        	            <a href="<c:url value="/recommenddetail/${rec.id }.html"/>" style="text-decoration:none;">
		                    	<h1>&nbsp;&nbsp;&nbsp;&nbsp;${rec.recName } </h1>
		                        <h2>&nbsp;&nbsp;&nbsp;&nbsp;￥${rec.summary }</h2>
		                        </a>
		                         <div class="order"> <a href="javascript:goCategory()">
		                        		<img src="m/images/recommend_order.png">
								</a> </div>
		                    </div>
		                </li>
          		</c:forEach>
            </ul>

          </div>      
          <div style=" width:60%; margin:0 auto;margin-top:10px;">
    		<c:if test="${enablePage }">
	    		<c:if test="${enableFirst }">
	    			<a href="<c:url value="/recommend?page=${prev }"/>"><img src="m/images/order_pre.png" width="35%" style="margin-right:24%;margin-left:2%;"></a>
	    		</c:if>
	    		<c:if test="${!enableFirst }">
	    			<img width="35%" style="margin-right:24%;margin-left:2%;">
	    		</c:if>
	    		<c:if test="${enableLast }">
	    			<a href="<c:url value="/recommend?page=${next }"/>"><img src="m/images/order_next.png" width="35%" style="text-align:right;"></a>
	    		</c:if>
	    	</c:if>
	     </div>		            	
    </div>
 
</body>
<%@ include file="footer.jsp" %>
<script type="text/javascript">
//添加进购物车
 function inCart(p){
	if(p.price <= 0)
	{
		$.messager.show("已下架,不能购买!",1000,function(){})
		return;
	}
	 $.cart.put(p);
	 $.messager.show("添加成功!",800,function(){
		 $("#init_count").html($.cart.count());
	 });
 }
 function goCategory(){
	 $.messager.show("前往红高粱首页!",1000,function(){
		 window.location.href = "./category?cid=${loginId}";
	 });	 
 }
 
 $(function(){
	 $("#init_count").html($.cart.count());
	 var length = $.cart.length();
	 if(length > 0) {
		//if(confirm("显示推荐商品，是否清空购物车?")) {
		//	window.localStorage.cart = "[]";
		//}
	 }
 });
 	$(document).ready(function(e) {
	    var w_height = $("list").height();
		$(".main .left").height(w_height);
	});
 </script>
</html>


<!-- 

 -->
